home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 734 / powervisor / s / pv / searchkeyword.pv < prev    next >
Text File  |  1995-03-18  |  4KB  |  118 lines

  1. /*========================================================================
  2.  
  3.   Use this ARexx script to search for a string in the PowerVisor hypertext
  4.   manual. This script is automatically called with the 'index' alias defined
  5.   in s:PowerVisor-startup. After typing 'index' PowerVisor will ask for
  6.   the string to search. After waiting a bit you will get a numbered list
  7.   with all topics where the string was found. Choose the right number to
  8.   go to that topic. Simply press enter to quit. This script will start
  9.   AmigaGuide to go to that topic. If you don't have AmigaGuide this script
  10.   is useles unless you change it.
  11.  
  12.   This script uses the 'searchit' utility in the 'pv:docs' subdirectory.
  13.   This utility searches a topic. There are two versions: 'searchit.gcc'
  14.   (compiled with the Gnu C compiler) and 'searchit.lc' (compiled with
  15.   the SAS/C 5.10 compiler). The gcc version is a lot faster, but it needs
  16.   the 'ixemul.library' (available from FTP). Copy the version you want
  17.   over 'searchit' (default is 'lc' version because this will always run).
  18.  
  19.   © Jorrit Tyberghein  16 Jul 1992 V1.0
  20.  
  21. ========================================================================*/
  22. options results
  23.  
  24. ti=pragma('Id')
  25.  
  26. 'unhide'
  27. 'print "Give string : "'
  28. 'scan'
  29. str=result
  30. 'print "'str'\0a"'
  31. if str=='' then exit
  32.  
  33. address command 'pv:docs/searchit pv:docs/PowerVisor.guide "'str'" >t:tmp'ti
  34. address command 'pv:docs/searchit pv:docs/GettingStarted.guide "'str'" >>t:tmp'ti
  35. address command 'pv:docs/searchit pv:docs/Expressions.guide "'str'" >>t:tmp'ti
  36. address command 'pv:docs/searchit pv:docs/Screen.guide "'str'" >>t:tmp'ti
  37. address command 'pv:docs/searchit pv:docs/InstallingPV.guide "'str'" >>t:tmp'ti
  38. address command 'pv:docs/searchit pv:docs/LookingAtThings.guide "'str'" >>t:tmp'ti
  39. address command 'pv:docs/searchit pv:docs/Debug.guide "'str'" >>t:tmp'ti
  40. address command 'pv:docs/searchit pv:docs/Scripts.guide "'str'" >>t:tmp'ti
  41. address command 'pv:docs/searchit pv:docs/CommandRef.guide "'str'" >>t:tmp'ti
  42. address command 'pv:docs/searchit pv:docs/Functions.guide "'str'" >>t:tmp'ti
  43. address command 'pv:docs/searchit pv:docs/Aliases.guide "'str'" >>t:tmp'ti
  44. address command 'pv:docs/searchit pv:docs/Lists.guide "'str'" >>t:tmp'ti
  45. address command 'pv:docs/searchit pv:docs/TechnicalInfo.guide "'str'" >>t:tmp'ti
  46. address command 'pv:docs/searchit pv:docs/Glossary.guide "'str'" >>t:tmp'ti
  47. address command 'pv:docs/searchit pv:docs/TheWizCorner.guide "'str'" >>t:tmp'ti
  48.  
  49. if ~open(file,'t:tmp'ti,'R') then
  50.     do
  51.         address command 'delete t:tmp'ti' >nil:'
  52.         'print "Error opening file !\0a"'
  53.         exit
  54.     end
  55.  
  56. line=readln(file)
  57. oldtitle=""
  58. i=1
  59. do while ~eof(file)
  60.     parse var line ': @Node 'nodename' "'titlename'"'
  61.     if oldtitle~=titlename then
  62.         do
  63.             'print "'i' : ·Å'titlename'Å\0a"'
  64.             titles.i=titlename
  65.             node.i=nodename
  66.             i=i+1
  67.         end
  68.     oldtitle=titlename
  69.     line=readln(file)
  70. end
  71.  
  72. 'print "Give number : "'
  73. 'scan'
  74. which=result
  75. 'print "'which'\0a"'
  76. do while datatype(which)==NUM
  77.     if pos(' : ',titles.which)==0 then
  78.             parse var titles.which fn' ('
  79.     else    parse var titles.which fn' :'
  80.     upper fn
  81.  
  82.     select
  83.         when fn=='GETTING STARTED' then fn='GettingStarted'
  84.         when fn=='EXPRESSIONS' then fn='Expressions'
  85.         when fn=='SCREENS AND WINDOWS' then fn='Screen'
  86.         when fn=='INSTALLING POWERVISOR' then fn='InstallingPV'
  87.         when fn=='LOOKING AT THINGS' then fn='LookingAtThings'
  88.         when fn=='DEBUGGING' then fn='Debug'
  89.         when fn=='SCRIPTS' then fn='Scripts'
  90.         when fn=='COMMAND REFERENCE' then fn='CommandRef'
  91.         when fn=='FUNCTION REFERENCE' then fn='Functions'
  92.         when fn=='ALIAS REFERENCE' then fn='Aliases'
  93.         when fn=='LIST REFERENCE' then fn='Lists'
  94.         when fn=='TECHNICAL INFORMATION' then fn='TechnicalInfo'
  95.         when fn=='GLOSSARY' then fn='Glossary'
  96.         when fn=='THE WIZARD CORNER' then fn='TheWizCorner'
  97.         otherwise
  98.             do
  99.                 'print "Error!\0a"'
  100.                 fn='Error'
  101.             end
  102.     end
  103.     if fn~='Error' then
  104.         do
  105.             node=strip(node.which,'B','"')
  106.             address command 'amigaguide pv:docs/'fn'.guide doc="'node'" screen=PowerVisorScreen'
  107.         end
  108.  
  109.     'print "Give number : "'
  110.     'scan'
  111.     which=result
  112.     'print "'which'\0a"'
  113. end
  114.  
  115. call close file
  116. address command 'delete t:tmp'ti' >nil:'
  117. exit
  118.